<template>
    <div>
        <h1 ref="countRef">{{count}}</h1>
        <button @click="count++">+</button>
        <button id="btn">--</button>
    </div>
</template>

<script>
export default {
    data(){
        return{
            count:1
        }
    },
    beforeCreate(){
        console.log('1、beforeCreate');
    },
    created(){
        console.log('2、created');
    },
    beforeMount(){
        console.log('3、beforeMount');
        console.log(this.$refs.countRef);
        
    },
    mounted(){
        console.log('4、mounted');
        console.log(this.$refs.countRef);
    },
    beforeUpdate(){
        console.log('5、beforeUpdate');
        console.log('data',this.count);
        console.log('dom',this.$refs.countRef.innerHTML);
    },
    updated(){
        console.log('6、update');
        console.log('data',this.count);
        console.log('dom',this.$refs.countRef.innerHTML);
    }
}
</script>

<style>

</style>